From: Florian Müllner Date: Fri, 13 Feb 2015 01:03:33 +0000 (+0100) Subject: appDisplay: Do not duplicate "New Window" action X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1862 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=12cb023050dd168929347f2954174d038ed6e4a0;p=gnome-shell.git appDisplay: Do not duplicate "New Window" action We assume that applications that export a 'new-window' action can open a new window, so we add an appropriate entry to the context menu. However this duplicates functionality if the application already exposes the action via the desktop file - don't add our own entry in that case. https://bugzilla.gnome.org/show_bug.cgi?id=744446 --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 066c44af4..3549f9a9e 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1820,7 +1820,10 @@ const AppIconMenu = new Lang.Class({ if (!this._source.app.is_window_backed()) { this._appendSeparator(); - if (this._source.app.can_open_new_window()) { + let appInfo = this._source.app.get_app_info(); + let actions = appInfo.list_actions(); + if (this._source.app.can_open_new_window() && + actions.indexOf('new-window') == -1) { this._newWindowMenuItem = this._appendMenuItem(_("New Window")); this._newWindowMenuItem.connect('activate', Lang.bind(this, function() { if (this._source.app.state == Shell.AppState.STOPPED) @@ -1832,8 +1835,6 @@ const AppIconMenu = new Lang.Class({ this._appendSeparator(); } - let appInfo = this._source.app.get_app_info(); - let actions = appInfo.list_actions(); for (let i = 0; i < actions.length; i++) { let action = actions[i]; let item = this._appendMenuItem(appInfo.get_action_name(action));